[(#REM) This block outputs if there are some products in the cart]
<div class="alohacart_cart_order_form_block">
<div class="alohacart_cart_block" >
    <INCLUDE{fond=formulaires/alohacart_cart_order/cart}{env}>
</div>

#ALOHACART_RECALCULATE_CART

[(#REM) [<div class="message_ok">(#ENV**{message_ok})</div>] ]					
[<div class="message_erreur">(#ENV**{message_erreur})</div>]

<form action="#ENV{action}" method="post" name="alohacart_cart_order_form" id="form_#FORM" class="google-analytics-form" >	
	<fieldset>
	#ACTION_FORMULAIRE{#ENV{action}}
	<input type="text" name="url" style="display: none;" value="" />
	<input type="hidden" name="lang" value="#LANG" />
		<div>
			<label for="name"><:alohacart:name:></label>
			<input type="text" name="name" id="name" value="#ENV*{name}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{name})</span>]
		</div>
		<div>
			<label for="phone"><:alohacart:phone:></label>
			<input type="text" name="phone" id="phone"  value="#ENV*{phone}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{phone})</span>]
		</div>
		<div> 
			<label for="email"><:alohacart:email:></label>
			<input type="text" name="email" id="email"  value="#ENV*{email}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{email})</span>]
		</div>
        <div>
            <label for="country"><:alohacart:country:></label>
            <input type="text" name="country" id="country"  value="#ENV*{country}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{country})</span>]
        </div>
        <div>
            <label for="city"><:alohacart:city:></label>
			<input type="text" name="city" id="city"  value="#ENV*{city}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{city})</span>]
        </div>
        <div>
            <label for="address"><:alohacart:address:></label>
			<input type="text" name="address" id="address"  value="#ENV*{address}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{address})</span>]
        </div>
        <div>
            <label for="street"><:alohacart:street:></label>
            <input type="text" name="street" id="street"  value="#ENV*{street}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{street})</span>]
        </div>
        <div>
            <label for="postcode"><:alohacart:postcode:></label>
            <input type="text" name="postcode" id="postcode"  value="#ENV*{postcode}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{address})</span>]
        </div>
        <div>
            <label for="house"><:alohacart:house:></label>
            <input type="text" name="house" id="house"  value="#ENV*{house}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{house})</span>]
        </div>
        <div>
            <label for="flat"><:alohacart:flat:></label>
            <input type="text" name="flat" id="flat"  value="#ENV*{flat}"/>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{flat})</span>]
        </div>
        <div class="alohacart_shipping_block">
            <INCLUDE{fond=formulaires/alohacart_cart_order/shipping}{env}>
        </div>
		<div class="alohacart_payment_block">
			<INCLUDE{fond=formulaires/alohacart_cart_order/payment}{env}>			
		</div>        
        <div>
            <label for="order_comments"><:alohacart:order_comments:></label>
            <textarea name="order_comments" id="order_comments">#ENV*{order_comments}</textarea>			
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{order_comments})</span>]
        </div>        
        [(#CONFIG{alohacart/allow_user_registration}|?{
		<div>
			<input type="checkbox" name="register_me" id="register_me" [(#ENV{register_me}|=={on}|?{'checked="checked"'})] />
            <label for="register_me" title="<:alohacart:register_me_title:>"><:alohacart:register_me:></label>
            [<span class='erreur'>(#ENV**{erreurs}|table_valeur{register_me})</span>]
        </div>        
		})]
		<input type="submit" value="<:alohacart:checkout:>" class="submit"/>
	</fieldset>
</form>
</div>

[(#REM) This block outputs if there are no products in the cart ]
<div class="alohacart_cart_order_form_empty_block" style="display: none;">
    [(#ENV{message_ok}|?{#ENV**{message_ok},
            <:alohacart:cart_is_empty:>
    })]
</div> 
<script type="text/javascript">
    [(#REM) This code needed here to hide or show cart block in case when form is processed via AJAX]
    $('#alohacart_cart_order_form').ready(function(){
        if (jQuery('.alohacart_cart_block input#num_products').val()>0) {
            jQuery('.alohacart_cart_order_form_block').show();
            jQuery('.alohacart_cart_order_form_empty_block').hide();
        } else {
            jQuery('.alohacart_cart_order_form_block').hide();
            jQuery('.alohacart_cart_order_form_empty_block').show();
        } 
    });
</script>